import express from 'express';
import {
  getClubs,
  getClubById,
  getClubByName,
  createClub,
  updateClub,
  deleteClub
} from '../controllers/clubController.js';
import { auth, hasPermission } from '../middleware/auth.js';

const router = express.Router();

// 社团管理路由
router.get('/',
  // auth,
  // hasPermission('read_clubs'),
  getClubs);
// 根据名称获取社团
router.get('/name',
  // auth,
  // hasPermission('read_clubs'),
  getClubByName);
// 根据ID获取社团
router.get('/:id',
  // auth,
  // hasPermission('read_clubs'),
  getClubById);
// 创建社团
router.post('/',
  auth,
  hasPermission('create_clubs'),
  createClub);
// 更新社团
router.put('/:id',
  auth,
  hasPermission('update_clubs'),
  updateClub);
// 删除社团
router.delete('/:id',
  auth,
  hasPermission('delete_clubs'),
  deleteClub);



export default router;